Skip to content

Fix two methane bugs: compounding unsaturated aerenchyma porosity, double-counted snow/pond resistance - #4351

Open
wwieder wants to merge 3 commits into
ESCOMP:masterfrom
wwieder:fix-ch4-aere-grndcond
Open

wwieder wants to merge 3 commits into
ESCOMP:masterfrom
wwieder:fix-ch4-aere-grndcond

Conversation

@wwieder

@wwieder wwieder commented Nov 23, 2026

Copy link
Copy Markdown
Contributor

Description of changes

This PR fixes two independent bugs in the methane model (src/biogeochem/ch4Mod.F90), each filed as its own issue. Each fix is a separate commit, so they can be reviewed or reverted on their own.

1. Unsaturated tiller-porosity reduction compounds with depth (#4349, commit 066cc39). SiteOxAere reassigned its poros_tiller dummy argument inside the soil-layer loop. In the sat = 0 pass, the unsat_aere_ratio (0.01) reduction was therefore applied again in each unfrozen layer below the water table, so tiller porosity reached the porosmin floor (1e-6) by layer jwt+3. Changes:

  • poros_tiller is now intent(in).
  • The reduction and the floor are applied to a new local, poros_tiller_eff, in each layer, so each layer gets the same reduced porosity.

This restores the behavior from before ctsm5.1.dev041, when the FATES–CH4 refactor moved the initial assignment out of the level loop. The issue has the history.

2. Snow and pond resistance double-counted in the saturated pass (#4350, commit 9ca921f). ch4_tran overwrote grnd_ch4_cond with the snow- and pond-inclusive conductance at the end of the sat = 0 call. The sat = 1 call then started from that value and added the resistances again. The history write-back now happens only when sat == 1, the last call of the timestep. Lakes also call ch4_tran with sat = 1 and reset their own conductance in LakeTemperatureMod, so they are unchanged. WTGQ still reports the snow- and pond-inclusive conductance, now with each resistance counted once.

Only src/biogeochem/ch4Mod.F90 changes.

Status: draft. The code has not been compiled or run yet.

Specific notes

Contributors other than yourself, if any:

  • Bugs found by the CTSM correctness audit (findings CH4-001, CH4-002); fixes drafted with AI assistance (Claude).

CTSM issues resolved or otherwise addressed, if any:

If answers are expected to change, describe (delete this line otherwise):

Any user interface changes (namelist or namelist defaults changes)?

  • No.

Testing planned or performed, if any:

  • ERP_D_Ld9.f10_f10_mt233.IHistClm60BgcCrop.derecho_intel.clm-clm60cam7LndTuningModeLDust--clm-nnStreamMapAlgo (expect baseline diffs in methane fields)
  • ERS_D_Ld5.f10_f10_mg37.I2000Clm50Fates.derecho_intel.clm-FatesCold (FATES path through SiteOxAere)
  • ERP_D_Ld10_P64x2.f10_f10_mg37.IHistClm60BgcCrop.derecho_intel.clm-ciso_decStart (December start, so there is snow): restarts bit-for-bit, WTGQ and CH4_SURF_*_SAT change only under snow or ponding
  • Single-column check that area_tiller in the sat = 0 pass is the same in every layer below jwt (for equal NPP terms)
  • aux_clm against baselines: expect DIFFs in tests with use_lch4

Questions for reviewers

wwieder and others added 2 commits November 23, 2026 06:11
SiteOxAere reassigned its poros_tiller dummy argument inside the level
loop, so in the sat=0 pass unsat_aere_ratio compounded for every unfrozen
layer below the water table. Make poros_tiller intent(in) and use a local
poros_tiller_eff, restoring the pre-ctsm5.1.dev041 behavior.

Fixes ESCOMP#4349

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…n pass

ch4_tran overwrote grnd_ch4_cond with the snow- and pond-inclusive value
at the end of the sat=0 call, and the sat=1 call then added those
resistances again. Only write the history value on the sat=1 (last) call.

Fixes ESCOMP#4350

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@wwieder wwieder added bug something is working incorrectly science Enhancement to or bug impacting science AI (LLM) guidance Things we do to our repo to try and keep AI coding agents on the rails labels Nov 23, 2026
@samsrabin samsrabin added AI-generated Stuff that was totally AI-generated, at least to start with. investigation Needs to be verified and more investigation into what's going on. and removed AI (LLM) guidance Things we do to our repo to try and keep AI coding agents on the rails labels Nov 23, 2026
@wwieder

wwieder commented Nov 27, 2026 •

Copy link
Copy Markdown
Contributor Author

Quicktest results (CH4-001, CH4-002)

Will ran this fix in an 80 year test against an unmodified baseline (case ctsm5.4.069_ch4-aere_f09_BGCcrop_188_quicktest) and asked Claude to:

Create a report that summarizes the key differences in ctsm5.4.069_<label>_f09_BGCcrop_188_quicktest experiments compared to the baseline case, ctsm5.4.069_baseline_f09_BGCcrop_188_quicktest.

All results are in /glade/derecho/scratch/wwieder/archive/*/lnd/hist and should have run for 80 years. Focus the analysis on the last 10 years of each simulation and focus on the changes expected based on the audit made here [audit fix tracker].

Also note if there are likely climate changing differences in LAI, ET, FSH, albedo, net radiation, soil moisture, or runoff. If it's helpful you can use plotting tools available in ~/python/ldf-native-grid-merge-main/.

Below is Claude's summary of the results for this PR.

Overall: No climate signal detected.

Expected: The audit expected a large increase in aerenchyma CH4 flux from non-inundated soils.

Found: As expected. Aerenchyma CH4 from non-inundated soils more than doubles (27.2 → 58.9 TgCH4/yr), and net CH4 emission rises +15.1% (172 → 198 TgCH4/yr). CH4 production is unchanged; less CH4 is oxidized on its way up. The change appears in the first year and stays steady.

No effect on the land energy or water budget. In a coupled run with interactive CH4 the +15% emission would matter, so the CH4 team should decide whether unsat_aere_ratio or scale_factor_aere need retuning.

Global land, years 71–80 Baseline Experiment Change % p < 0.05 Units
Net CH4 flux (FCH4) 172 198 +26.1 +15.1% yes TgCH4/yr
CH4 production (CH4PROD) 831 831 +0.132 +0.0% yes TgCH4/yr
Aerenchyma CH4, non-inundated (CH4_SURF_AERE_UNSAT) 27.2 58.9 +31.7 +116.7% yes TgCH4/yr
Aerenchyma CH4, inundated (CH4_SURF_AERE_SAT) 3,420 3,420 −0.0720 −0.0% no TgCH4/yr
Diffusive CH4, non-inundated (CH4_SURF_DIFF_UNSAT) −25.0 −27.1 −2.08 −8.3% yes TgCH4/yr
Diffusive CH4, inundated (CH4_SURF_DIFF_SAT) 7.32 7.32 +0.00225 +0.0% no TgCH4/yr
NPP (NPP) 42.7 42.7 −4.90e−04 −0.0% no PgC/yr

Key figures

Net CH4 flux
Net CH4 flux: experiment minus baseline, years 71–80. Grey cells have no significant change (paired t, p < 0.05); significant over 19% of the plotted land.

Aerenchyma CH4, non-inundated
Aerenchyma CH4, non-inundated: experiment minus baseline, years 71–80. Grey cells have no significant change (paired t, p < 0.05); significant over 24% of the plotted land.

Global net CH4 emission difference over the 80 years
Global net CH4 emission difference over the 80 years: the increase appears in the first year and stays steady. Shaded band: years 71–80, the period analysed.

Could this change the simulated climate?

Share of land where the change is both significant and larger than a threshold, taking the worst of the annual mean and the four seasons:

LAI (≥0.100 m2/m2): 0.1%; ET (latent heat) (≥1.00 W/m2): 0.1%; Sensible heat (≥1.00 W/m2): 0.1%; Albedo (≥0.0100 -): 0.0%; Net radiation (≥1.00 W/m2): 0.0%; Soil moisture (top 10 cm) (≥5%): 0.0%; Runoff (≥10%): 0.0%.

≥ 5% of land in any column is flagged likely climate-changing, 1–5% regional. The thresholds are judgement calls; these are land-only runs, so the atmosphere cannot respond.

Setup

80-year land-only runs: 1850_DATM%CRUJRA2024b_CLM60%BGC-CROP, f09, all started from the same spun-up 1850 restart with identical namelists and CRUJRA forcing (1901–1920 cycled). Each experiment is ctsm5.4.069 plus only its fix commits, compared with an unmodified ctsm5.4.069 baseline over years 71–80. Significance uses a two-sided paired t-test across the 10 annual means (p < 0.05), pairing years that used the same forcing.

Analysis scripts: /glade/u/home/wwieder/audit_quicktest_analysis on GLADE (extract.py, analysis.py). Analysis and write-up prepared with AI assistance (Claude).

@wwieder

wwieder commented Nov 29, 2026 •

Copy link
Copy Markdown
Contributor Author

pSASU spin-up results (CH4-001, CH4-002)

Follow-up to the quicktest results above. Will also ran this fix through a full cold-start spin-up (AD → SASU → pSASU; case ctsm5.4.069_fix-ch4-aere-grndcond_f19_BGCcrop_189_pSASU) alongside an unmodified baseline spin-up (ctsm5.4.069_baseline_f19_BGCcrop_189_pSASU), and asked Claude to:

repeat the analysis from the quicktests posted here [link to the quicktest report] but with the pSASU runs. Focus they analyses on the last 20 years available pSASU resutls and compare each of the test cases with the baseline results.

Below is Claude's summary of the results for this PR.

Updated Nov 30, 2026: the ch4-aere pSASU run has now reached year 240, so this comment compares pSASU years 221–240, like the other cases. It previously used years 149–168 while the run was still going; the results changed by less than 0.1 percentage points.

Overall: No climate signal detected.

Found: Aerenchyma CH4 from non-inundated soils more than doubles (20.4 → 44.1 TgCH4/yr), and net CH4 emission rises 10% (181 → 200 TgCH4/yr; quicktest +15.1%). CH4 production barely changes. Ecosystem C differs by +1.99 PgC.

The same conclusion as the quicktest: no effect on the land energy or water budget, but a CH4 emission change large enough that the CH4 team should decide whether unsat_aere_ratio or scale_factor_aere need retuning.

Regional: The Amazon accounts for 8.31 of the 18.6 TgCH4/yr global increase (45%). The boreal lowlands add 1.9 (West Siberian Lowland) and 1.0 TgCH4/yr (Hudson Bay Lowlands). Everywhere the gain is in the aerenchyma flux from non-inundated soil, which roughly doubles (96–152%), while CH4 production does not change.

Global land, pSASU years 221–240 Baseline Experiment Change % Quicktest % p < 0.05 Units
Net CH4 flux (FCH4) 181 200 +18.6 +10.3% +15.1% yes TgCH4/yr
CH4 production (CH4PROD) 821 821 +0.260 +0.0% +0.0% yes TgCH4/yr
Aerenchyma CH4, non-inundated (CH4_SURF_AERE_UNSAT) 20.4 44.1 +23.8 +117.0% +116.7% yes TgCH4/yr
Aerenchyma CH4, inundated (CH4_SURF_AERE_SAT) 3,405 3,406 +0.410 +0.0% −0.0% yes TgCH4/yr
Diffusive CH4, non-inundated (CH4_SURF_DIFF_UNSAT) −28.4 −30.3 −1.91 −6.7% −8.3% yes TgCH4/yr
Diffusive CH4, inundated (CH4_SURF_DIFF_SAT) 7.54 7.54 +0.00207 +0.0% +0.0% no TgCH4/yr
NPP (NPP) 44.1 44.1 +0.00373 +0.0% −0.0% yes PgC/yr
Total ecosystem C (TOTECOSYSC) 3,368 3,370 +1.99 +0.1% +0.0% yes PgC

Key figures

Net CH4 flux
Net CH4 flux: experiment minus baseline after the full spin-up, pSASU years 221–240. Grey cells have no significant change (paired t, p < 0.05); significant over 24% of the plotted land.

Could this change the simulated climate?

Share of land where the change is both significant and larger than a threshold, worst of the annual mean and four seasons (quicktest value in brackets):

LAI (≥0.100 m2/m2): 0.0% [quicktest 0.1%]; ET (latent heat) (≥1.00 W/m2): 0.1% (JJA) [quicktest 0.1%]; Sensible heat (≥1.00 W/m2): 0.0% [quicktest 0.1%]; Albedo (≥0.0100 -): 0.0% [quicktest 0.0%]; Net radiation (≥1.00 W/m2): 0.0% [quicktest 0.0%]; Soil moisture (top 10 cm) (≥5%): 0.1% [quicktest 0.0%]; Runoff (≥10%): 0.1% [quicktest 0.0%].

≥ 5% of land in any column is flagged likely climate-changing, 1–5% regional. The thresholds are judgement calls; these are land-only runs.

Setup

Each case is a cold-start spin-up with its fix in place: I1850Clm60BgcCropCrujra, f19_t233, 360 years of accelerated decomposition (AD), 360 years of SASU (hybrid from AD year 361), then 240 years of pSASU (hybrid from SASU year 361, spin-up off). CRUJRA 1901–1920 forcing is cycled with DATM_YR_ALIGN=1, so a given model year has the same forcing in every case. We compare the last 20 pSASU years (221–240) with the same years of the baseline spin-up. Significance is a two-sided paired t-test across the 20 annual means (p < 0.05). Spin-up noise floor: fixes with no plausible carbon pathway (snicar, wf2-accumulator, crop-retrans) end with ecosystem C +0.10 to +0.93 PgC different from the baseline, so treat slow-pool differences of about 1 PgC as noise.

Analysis scripts: /glade/u/home/wwieder/audit_quicktest_analysis on GLADE (extract.py, analysis.py and regional.py run with psasu). Analysis and write-up prepared with AI assistance (Claude).

@wwieder

wwieder commented Nov 30, 2026

Copy link
Copy Markdown
Contributor Author

Implications (CH4-001, CH4-002)

Short summary of what the full cold-start spin-up (AD → SASU → pSASU, f19 BGC-Crop, 1850) means for this fix.

CH4-001 (SiteOxAere compounds unsat_aere_ratio across layers (poros_tiller mutated inside level loop)): No climate signal; CH4 emissions change. Tested together with CH4-002 (#4351). Aerenchyma CH4 from non-inundated soils more than doubles (20 → 44 TgCH4/yr), and net CH4 emission rises 10% (181 → 200 TgCH4/yr), 45% of the increase in the Amazon. CH4 production is unchanged, and the land energy and water budgets are unaffected. The CH4 team should decide whether unsat_aere_ratio or scale_factor_aere need retuning before merge.

CH4-002 (grnd_ch4_cond_col overwritten in sat=0 ch4_tran call, so snow/pond resistance is double-counted in sat=1 call): No climate signal; CH4 emissions change. Tested together with CH4-001 (#4351); the spin-ups cannot separate the two. Combined, net CH4 emission rises 10% (181 → 200 TgCH4/yr), almost all of it from the aerenchyma flux from non-inundated soils. No effect on the land energy or water budget. Decide on CH4 retuning together with CH4-001.

Details: full pSASU results above

Prepared with AI assistance (Claude) from the pSASU analysis in /glade/u/home/wwieder/audit_quicktest_analysis on GLADE.

@wwieder

wwieder commented Dec 2, 2026 •

Copy link
Copy Markdown
Contributor Author

Historical simulation results (CH4-001, CH4-002)

Follow-up to the pSASU results above. Will continued both spin-ups into transient historical runs, 1850–2023 (ctsm5.4.069_fix-ch4-aere-grndcond_f19_BGCcrop_189_HIST and ctsm5.4.069_baseline_f19_BGCcrop_189_HIST). Each starts from its own pSASU restart, so the fix has been in place since the cold start. Will asked Claude to compare the last 20 years (2004–2023) with the baseline and to flag responses that are stronger or weaker than in pSASU. Below is Claude's summary for this PR.

Overall: same behaviour as in pSASU. No climate signal.

Found: net CH4 emission rises +26.2 TgCH4/yr (+10.6%) over 2004–2023 (246 → 272 TgCH4/yr; p < 0.001), against +18.6 (+10.3%) in pSASU. The relative increase stays at about 10–11% throughout the record. The absolute increase grows as baseline emissions rise, from about +19 TgCH4/yr in the 1850s to +26 in 2004–2023. The spatial pattern matches pSASU (pattern r = 0.90), with significant changes over 24% of land. CH4 production is unchanged (+0.05%), so the extra emission is still the aerenchyma pathway from non-inundated soil. Ecosystem C is +1.9 PgC higher, the same offset as in pSASU and within the spin-up noise floor.

Global land 1850–1869 1950–1969 2004–2023 pSASU 221–240 Units
Net CH4 flux (FCH4), baseline 194 209 246 181 TgCH4/yr
Net CH4 flux, ch4-aere 213 233 272 200 TgCH4/yr
Change +18.8 (+9.7%) +23.8 (+11.4%) +26.2 (+10.6%) +18.6 (+10.3%) TgCH4/yr
CH4 production (CH4PROD) change +0.05% +0.05% +0.05% +0.03%
Total ecosystem C (TOTECOSYSC) change +2.0 +1.9 +1.9 +2.0 PgC

By season (2004–2023): the increase is largest in MAM (+40 TgCH4/yr, +20%) and JJA (+38, +9%). SON is the only season where the response is clearly stronger than in pSASU: +14.9 (+6.0%) against +7.9 (+4.6%), 1.8× the pSASU change. The other seasons scale with baseline emissions (1.2–1.5×).

Global net CH4 flux, HIST
Left: global net CH4 flux. Right: ch4-aere minus baseline, annual and 10-year running mean. Shaded: 2004–2023.

Net CH4 flux map, annual
Annual net CH4 flux, ch4-aere minus baseline: pSASU years 221–240 (left) and HIST 2004–2023 (right), shared colour scale. Grey: not significant (paired t-test, p ≥ 0.05).

SON map

Net CH4 flux map, SON

Implication: the historical run confirms the pSASU conclusion. The fix changes CH4 emissions by about 10% and nothing else. Because baseline emissions rise over the historical period, the absolute effect is about 40% larger by the present day (+26 vs +19 TgCH4/yr). Any retuning of unsat_aere_ratio or scale_factor_aere should be judged against present-day emissions.

Setup

HIST_DATM%CRUJRA2024_CLM60%BGC-CROP, f19_t233, transient land use, 1850–2023. Each case starts from its own pSASU year-241 restart: AD 360 yr → SASU 360 yr → pSASU 240 yr, all with the fix in place. Analysis window: 2004–2023 (last 20 complete years), compared cell by cell with the same years of the baseline and with pSASU years 221–240. Significance is a paired t-test across the 20 annual (or seasonal) means, p < 0.05. Global values are land totals from monthly h0a output.

Analysis scripts: /glade/u/home/wwieder/audit_quicktest_analysis on GLADE (hist_extract.py, extract.py hist, hist_spatial.py, hist_pr_figs_ch4.py). Analysis and write-up prepared with AI assistance (Claude).

@wwieder

wwieder commented Dec 3, 2026 •

Copy link
Copy Markdown
Contributor Author

Given large changes in unsaturated aerenchyma fluxes I've started two new runs branching from 1983 of the f19_HIST case with modifications to the unsat_aere_ratio.

  • The default (following calibration for WIEMIP in LMWG_dev_#157) was set to 0.01.
  • This bug fix more than doubled CH4_SURF_AERE_UNSAT from 20.4 -> 44.1 TgCH4/y
  • It seems like this response to unsat_aere_ratio is pretty linear to two tests set it to 0.004 and 0.005
  • Results from the quicktest suggest "The change appears in the first year and stays steady", suggesting this short run will be appropriate for evaluation

Will post results from this retuning activity when runs complete and suggest changes to the parameter file for this PR.

@wwieder
wwieder marked this pull request as ready for review December 4, 2026 22:37
@wwieder

wwieder commented Dec 4, 2026

Copy link
Copy Markdown
Contributor Author

Setting unsat_aere_ratio = 0.003 seems to give:

  • CH4_SURF_AERE_UNSAT fluxes that are similar to the the baseline runs (25.9 baseline vs. 25.4 bug fix + parameter mods; TgCH4/yr Global, 2004–2023). I'm not sure Claude is weighting these fluxes correctly, but they're being handled consistently across runs. Spatial patterns aren't identical, but I'm not too worried about replicating behavior exactly
  • net methane fluxes FCH4 are now basically identical (245 TgCH4/y)

This was determined with a series of historical runs from pSASU initial conditions in the original sweep of bug-fix simulations.
.../scratch/wwieder/archive/ctsm5.4.069_fix-ch4-aere-unsat003_f19_BGCcrop_189_HIST

Should this parameter change come in on this PR, or wait for a larger bug calibration PR after @linniahawkins's results are in?

Marking as ready for review and submitting suggested tests, above.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

AI-generated Stuff that was totally AI-generated, at least to start with. bug something is working incorrectly investigation Needs to be verified and more investigation into what's going on. science Enhancement to or bug impacting science

Projects

None yet

2 participants